import time

from selenium import webdriver
from selenium.webdriver.common.by import By

# 1.创建浏览器驱动对象
driver=webdriver.Chrome()
# 2.通过get方法获取网页
driver.get("http://localhost:8081/regA.html")


ele=driver.find_element(By.CSS_SELECTOR,"input[name='upfilea']")
# 必须走绝对路径  只支持类型为file
ele.send_keys(r"D:\soft\PycharmProjects\UiAutoProject\day04\img\1.png")

time.sleep(20)
# 4.关闭浏览器对象
driver.quit()  # 关闭浏览器